﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RAS
{
    internal class LED
    {

        private PictureBox pictureBox;

        /// <summary>
        /// 配置依赖的pictureBox
        /// </summary>
        /// <param name="picB">依赖的pictureBox</param>
        public void SetPicBox(PictureBox picB)
        {
            pictureBox = picB;
            picB.SizeMode = PictureBoxSizeMode.Zoom;
            Off();
        }


        private const string on = "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACplJREFUeF7tnVFuGzcQhrkyqqI3SJ2HOm92LlHnJLFPkuQkdk4S5xK23+KXqLlBUQXWFrKtRJEl7Yw4XA1nPwFFC3TIFf+fH2fI9WqbxKc3BV5Oj8/a1FzkXLBJ7fnX8e1lTh+0lSvQyEOJzFUAQHIV7L89gPSoOYD0KLbRpQDESEhJNwAiUclXDID06AeA9Ci20aUAxEhISTcAIlHJVwyA9OgHgPQottGlAMRISEk3ACJRyVcMgPToB4D0KLbRpQDESEhJNwAiUclXDID06AeA9Ci20aUAxEhISTcAIlHJVwyA9OgHgPQottGlAMRISEk3ACJRyVcMgPToB4D0KLbRpQDESEhJNwAiUclXDID06AeA9Ci20aUAxEhISTcAIlHJVwyA9OgHgPQottGlqgbkcPr6YnY/+/Dtj9s7Iz2KdjM0QF78e3w0Ohi9q8mj1QlQLSB/Tk8+NSmdppTuZvftmxogGRIgcziag+aiNo9CALIEx2I8VUAyFEBW4KjKo+oBWQNHNQYMAZANcPzwaDK+eVW0jjXuvKoSawscVUASHZDHPUfzpWOO3tUESTWACOBwD0lkQIRwVJdJqgBEAYdrSKICooSjKkjcA7IDHG4hiQjIjnBUA4lrQDLgcAlJNEAy4agCEreAGMDhDpJIgBjB4R4Sl4AYwuEKkiiAvPh+fDpqm0/GJ6ouT7fcAVIADjeQRACkEBxuM4krQB7S9ii9TU3z3nh1cgFJ7YAUhiOl1FxOxtfnhbzfqVtXgMx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SYHwBizBAyiC1DAMSWH2QQY34AiDFDyCC2DAEQW36QQYz5ASDGDCGD2DIEQGz5QQYx5geAGDOEDGLLEACx5UeRT5MKYRPCReqDRPMHw/oQTlMG7GXypmgQ29bN8yCxA06JA5AU9epsCyAC3wBEIJaTUAARGAkgArGchAKIwEgAEYjlJBRABEYCiEAsJ6EAIjASQARiOQkFEIGRACIQy0kogAiMBBCBWE5CAURgJIAIxHISCiACIwFEIJaTUAARGAkgArGchAKIwEgAEYjlJBRABEYCiEAsJ6EAIjASQARiOQkFEIGRACIQy0kogAiMBBCBWE5CAURgJIAIxHISCiACIwFEIJaTUAARGAkgArGchAKIwEgAEYjlJBRABEYCiEAsJ6EAIjASQARiOQkFEIGRACIQy0kogAiMBBCBWE5CAURgJIAIxHISCiACIwFEIJaTUAARGAkgArGchAKIwEgAEYjlJBRABEYCiEAsJ6EAIjASQARiOQkFEIGRACIQy0kogAiMBBCBWE5CAURgJIAIxHISCiACIwFEIJaTUAARGAkgArGchAKIwEgAEYjlJBRABEYCiEAsJ6EAIjASQARiOQkFEIGRACIQy0kogAiMBBCBWE5CAURg5PX+7rkg/FVo1/ffjm9uL1L6uNrbOW2b5q+UPg6ns7OU9mNqCyBjcpuxihUAELFkNBiTAgAyJrcZq1gBABFLRoMxKQAgY3KbsYoVABCxZDQYkwIAMia3GatYAQARS0aDMSnwP4as3kEnX2uyAAAAAElFTkSuQmCC";
        private const string warn = "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACmdJREFUeF7tnUFyGzcQRTFUNqmil2Eqq8i7mJU7RD6JpZPYPonkk1i+Q4rJztqlwizNqmwiTUybtCV5SKCJBtjoeazyyj0Y4n88dPcMR9MFPtUUWC3n5yGEy8wTXkxni6vMMTg8UYEuMY4wBQUAREHEykMASEXBAaSi2EqnAhAlIVOGAZAUlWzFAEhFPwCkothKpwIQJSFThgGQFJVsxQBIRT8ApKLYSqcCECUhU4YBkBSVbMUASEU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QAgY3KbuYoVABCxZBwwJgUAZExuM1exAgAilowDxqTA/w8THTLllY0DAAAAAElFTkSuQmCC";

        /// <summary>
        /// Base64编码转图片
        /// </summary>
        /// <param name="str">base64编码字符串</param>
        /// <returns></returns>
        private Image ConvToImg(string str)
        {
            byte[] bytefile;
            bytefile = Convert.FromBase64String(str);
            MemoryStream ms = new MemoryStream(bytefile);
            return Image.FromStream(ms);
        }

        /// <summary>
        /// 亮绿灯
        /// </summary>
        public void On()
        {
            pictureBox.Image = ConvToImg(on);
        }

        /// <summary>
        /// 灯灭
        /// </summary>
        public void Off()
        {
            pictureBox.Image = ConvToImg(off);
        }

        /// <summary>
        /// 亮红灯
        /// </summary>
        public void Error()
        {
            pictureBox.Image = ConvToImg(error);
        }

        /// <summary>
        /// 亮黄灯
        /// </summary>
        public void Warn()
        {
            pictureBox.Image = ConvToImg(warn);
        }
    }
}
